package com.library.service.serviceImpl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.library.dto.pojo.MessageDto;
import com.library.entity.Admin;
import com.library.mapper.AdminMapper;
import com.library.service.IAdminService;
import com.library.utils.sms.EmailUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 至尊伍人组
 * @since 2018-09-30
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements IAdminService {

    @Autowired
    EmailUtils emailUtils;

    /**
     * 用于发送电子邮件
     *
     * @param md 通讯类对象（内含通讯属性）
     */
    @Override
    public void sendEmail( MessageDto md ) {

        try {
            emailUtils.sendEmail(md.getEmail(), md.getMessage(), md.getFilepath());
        } catch ( Exception e ) {
        }

    }

    /**
     * 用于发送手机短信
     *
     * @param messageDto 通讯类对象（内含通讯属性）
     */
    @Override
    public void sendSMS( MessageDto messageDto ) {

    }
}
